<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- jsp文件头和头部 -->
    <%@ include file="../base/top.jsp" %>
</head>
<body class="no-skin">
<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <div style="width: 70%; margin: auto;">
                            <p style="margin-top: 30px; margin-bottom: 20px; font-size: 24px;  text-align: center;
	                            font-family: 'Microsoft Yahei', arial, Tahoma, sans-serif; background-repeat: no-repeat;">${judgeDetail.projectName}</p>

                            <p style="font-size: 17px; text-align: center; font-family: 宋体; color: rgb(0, 0, 0); background-repeat: no-repeat;">
                                小组成员：<c:forEach items="${studentInfos}" var="student">
                                ${student.stuName}
                            </c:forEach></p>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-6">
                        <div style="margin-right: 10%;float:right;">
                            <div class="form-group">
                                <div style="margin-top: 10px;">
                                    <table style="margin-top: 20px; font-size: 17px; font-family: 宋体;height:300px;"  border="0" >
                                        <tr> <td colspan="2" class="center">
                                            <img src="static/images/office-icon/word.ico" width="70px">
                                        </td></tr>
                                        <tr><td colspan="2" class="center">
                                            <p class="btn btn-link"
                                               style="font-size: 17px;  font-family: 宋体; background-repeat: no-repeat;">
                                                ${assignmentFile.assignmentName}v${assignmentFile.assignmentVersion}.0
                                                    <a title="下载" id="load1"><i id="1nav-search-icon" class="ace-icon fa fa-cloud-upload bigger-110 nav-search-icon blue"></i></a>
                                            </p>
                                        </td></tr>
                                        <tr>
                                            <th style="text-align:center">上传时间</th>
                                            <td style="padding-left: 20px"> ${assignmentFile.assignmentCreateTime}</td>
                                        </tr>
                                        <tr>
                                            <th style="text-align:center">标签</th>
                                            <td style="padding-left: 20px">
                                                <c:forEach items="${judgeDetail.labels}" var="label">
                                                    ${label.labelName}
                                                </c:forEach>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th style="text-align:center">评语</th>
                                            <td style="padding-left: 20px"> ${assignmentFile.assignmentJudgement}</td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-6">
                        <div style="margin-left: 10%;">
                            <div class="form-group">
                                <div style="margin-top: 10px;">
                                    <table style="margin-top: 20px; font-size: 17px; font-family: 宋体;" height="300px" border="0" >
                                        <c:if test="${not empty assignmentFile.assignmentJudgeAddress}"><tr> <td colspan="2" class="center">
                                            <img  src="static/images/office-icon/word.ico" width="70px">
                                        </td></tr>
                                        <tr><td colspan="2" class="center">
                                            <p class="btn btn-link"style="font-size: 17px;  font-family: 宋体; background-repeat: no-repeat;">
                                                    ${assignmentFile.assignmentName}v${assignmentFile.assignmentVersion}.0评阅
                                                <a title="下载" id="load"><i id="nav-search-icon" class="ace-icon fa fa-cloud-upload bigger-110 nav-search-icon blue"></i></a>
                                            </p>
                                        </td></tr>
                                        <tr>
                                            <th style="text-align:right">评审时间
                                            </th>
                                            <td style="padding-left: 20px">${assignmentFile.assignmentJudgeCreateTime}
                                            </td>
                                        </tr>
                                        <tr>
                                            <th style="text-align:right">批改教师
                                            </th>
                                            <td style="padding-left: 20px">${judgeDetail.teaName}
                                            </td>
                                        </tr></c:if>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<%@ include file="../base/foot.jsp"%>
<script type="text/javascript">

    $("#load").click(function () {
        $.ajax({
            type:"POST",
            url:"<%= basePath%>assignment/downloadFlowAssignment",
            data:{
                assignmentId:"${assignmentFile.assignmentId}",
            },
            dataType:'json',
            success:function (data) {
                //alert(":");
                var obj = eval(data);
                var fileType =obj.fileType;
                var name = obj.assignmentName;
                var address = obj.assignmentJudgeAddress;
                //alert(address);
                //alert(name+fileType,address);
                download(name+fileType,address);
            }
        })
    });
    $("#load1").click(function () {
        $.ajax({
            type:"POST",
            url:"<%= basePath%>assignment/downloadFlowAssignment",
            data:{
                assignmentId:"${assignmentFile.assignmentId}",
            },
            dataType:'json',
            success:function (data) {
                //alert(":");
                var obj = eval(data);
                var fileType =obj.fileType;
                var name = obj.assignmentName;
                var address = obj.assignmentAddress;
                //alert(address);
                //alert(name+fileType,address);
                download(name+fileType,address);
            }
        })
    });
</script>
</body>
</html>
